package com.summer.applet.entity;

import java.awt.event.KeyEvent;

public class Rocker {
	
	public static void control(KeyEvent keyEvent,Snake snake) {	
		switch (keyEvent.getKeyCode()) {
			case KeyEvent.VK_W:
				snake.directionAction(Snake.DIRECTION_UP);
				break;
			case KeyEvent.VK_S:
				snake.directionAction(Snake.DIRECTION_DOWN);
				break;
			case KeyEvent.VK_A:
				snake.directionAction(Snake.DIRECTION_LEFT);
				break;
			case KeyEvent.VK_D:
				snake.directionAction(Snake.DIRECTION_RIGHT);
				break;
		}
	}
	
}
